package models.mappers;

import java.util.List;

import models.SystemMenu;
import models.User;

import org.apache.ibatis.annotations.Select;

public interface SystemMenuMapper {
	/**
	 * 根据父ID查询菜单
	 *
	 * @Title: selectById 
	 * @param id 父节点ID
	 * @return
	 * @return: SystemMenu 菜单对象
	 */
	 @Select("select menuid,menuname,menuurl,parentid from "
	 		+ SystemMenu.TABLE_NAME
	 		+ " where parentid=#{id} order by sort")
	 List<SystemMenu> selectChildren(String id);
	 
	 /**
	 * 查询父菜单
	 *
	 * @Title: selectById 
	 * @return
	 * @return: SystemMenu 菜单对象
	 */
	 @Select("select menuid,menuname,menuurl from "
	 		+ SystemMenu.TABLE_NAME
	 		+ " where parentid is null or parentid='' order by sort")
	 List<SystemMenu> selectMenus();
}
